import { fetchOperateDetails } from './util';
import InfoModal from '../../../components/InfoModal';
import { FILE_RENDER, REASON_RENDER } from './renderUtil'; // 验收不通过弹窗---

export const showAcceptanceFailedInfoModal = async (id, operateRecordId) => {
    const dataSource = await fetchOperateDetails(id, operateRecordId);
    const columns = [
        {
            title: '验收结果',
            dataIndex: 'auditStatus',
            render: value => `${value === 1 ? '通过' : '不通过'}`
        },
        {
            title: '原因',
            dataIndex: 'operateReason',
            require: true,
            render: REASON_RENDER
        },
        {
            title: '附件',
            dataIndex: 'taskOperateFile',
            render: FILE_RENDER
        }
    ];
    return InfoModal.showCommonModal({ columns, dataSource, title: '详情' });
};
